package com.codeos.khttp.utils;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;

public class KHttpUtils {

    public static final String gHttpEnd = "\r\n";

    public static String getStackTrace(Throwable t) {

        try(StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw)) {

            t.printStackTrace(pw);
            return sw.toString();
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }
}
